package com.zhiwei.codesecurity.common.webservice.checkmarx.wsdk.client;

public enum ClientType {
    ZIP("ZIP"), SVN("SVN"), GIT("GIT"), Unknow("");

    private String name;

    ClientType(String name){
        this.setName(name);
    }

    public static ClientType fromName(String name) {
        ClientType type = ClientType.Unknow;
        if (name == null || (name = name.toUpperCase()).equals("")) {
            return type;
        }
        for (ClientType ct : ClientType.values()) {
            if (ct.getName().equals(name)) {
                type = ct;
                break;
            }
        }
        return type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
